﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PocketEngine.Engine;
namespace PocketEngine.Particles.Types
{
    public class pSquareParticle : pParticle
    {
       
        public override pParticle Clone(pColor col)
        {
            var r = new pSquareParticle();
            r.Visual = Visual;
            r.Size = Size;
            r.Decline = Decline;
            r.Color = col;
            r.CastLight = CastLight;
            r.Simulated = Simulated;
            if (Simulated)
            {
                r.Entity = new PocketEngine.Physics.pEntity(new PocketEngine.Physics.pBoxBody(16, 16, 8), null);
                r.Entity.Geom = new PocketEngine.Physics.pBoxGeom(r.Entity.Body as Physics.pBoxBody);

            }
            return r as pParticle;
        }
        public override void Update(Maps.pMap map)
        {
            base.Update(map);
        }
        public override void Draw()
        {
            Color.A = Alpha;
            
            pEngine.Pen.TransformedImageShadowMapping((int)Position.X - 2, (int)Position.Y - 2, (int)4, (int)4, Visual, Color, Rotation, Size);
            //pEngine.Pen.TransformedImage(20, 20, 200, 200, Visual, pColor.White, 0, 1);
           // Console.WriteLine("size:" + Size);
            //Console.WriteLine("px:" + Position.X + " py:" + Position.Y);
            //'Console.WriteLine("Drew particle.");
        }
    }
}
